#define _CRT_SECURE_NO_WARNINGS 1
typedef struct ListNode ListNode;
ListNode* dfs(ListNode* head, ListNode* node)
{
	ListNode* Next_node = node->next;
	node->next = head;

	if (!Next_node)
		return node;
	return dfs(node, Next_node);
}

struct ListNode* reverseList(struct ListNode* head) {
	if (!head || !head->next)
		return head;

	ListNode* node = head->next;
	head->next = NULL;
	return dfs(head, node);
}